package com.qj.platform.pay.core.domain;

import com.qj.base.commons.utils.DateUtils;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Name;
import org.nutz.dao.entity.annotation.Readonly;
import org.nutz.dao.entity.annotation.Table;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * Created by zhijie on 2016/12/15.
 */
@Table("order_")
public class Order {
    @Name
    @Column("id")
    private String oriReqMsgId;
    @Column("ori_resp_type")
    private String oriRespType;
    @Column("ori_resp_code")
    private String oriRespCode;
    @Column("ori_resp_msg")
    private String oriRespMsg;
    //订单金额
    @Column("total_amount")
    private double totalAmount;
    //买家实付金额
    @Column("buyer_pay_amount")
    private double buyerPayAmount;
    //积分支付金额
    @Column("point_amount")
    private double pointAmount;
    @Column("operator_id")
    private String operatorId;
    @Column("store_id")
    private String storeId;
    @Column("terminal_id")
    private String terminalId;
    //支付宝渠道：买家支付宝用户号
    @Column("buyer_id")
    private String buyerId;
    //支付宝渠道：买家帐号 如 **233@qq.com
    @Column("buyer_account")
    private String buyerAccount;
    @Column("settle_date")
    private Date settleDate;
    //0正常清算-1发生撤销，渠道不产生退款
    @Column("is_clear_or_cancel")
    private String isClearOrCancel;;
    /*支付渠道流水*/
    @Column("channel_no")
    private String channelNo;
    @Column
    private String extend1;
    @Column
    private String extend2;
    @Column
    private String extend3;
    @DateTimeFormat(pattern = DateUtils.DEFAULT_TIME_PATTERN)
    @Column("create_time")
    private Date createTime;
    @DateTimeFormat(pattern = DateUtils.DEFAULT_TIME_PATTERN)
    @Column("modify_time")
    private Date modifyTime;
    //银行商户编码
    @Column("merchant_code")
    private String merchantCode;
    @Column("merchant_name")
    @Readonly
    private String merchantName;
    //订单标题
    @Column("subject")
    private String subject;
    //订单描述
    @Column("remark")
    private String desc;
    //指定支付方式
    //目前仅当微信支付模式下可用。
    //1-限定不能使用信用卡支付
    @Column("limit_pay")
    private String limitPay;
    //二维码链接,返回报文包含
    //包含订单信息的二维码链接，商户通过该链接生成二维码供用户扫码支付
    @Column("qr_code")
    private String qrCode;
    @Column("sub_app_id")
    private String subAppid;
    @Column("status")
    private String status;

    public String getSubAppid() {
        return subAppid;
    }

    public void setSubAppid(String subAppid) {
        this.subAppid = subAppid;
    }

    public String getOriReqMsgId() {
        return oriReqMsgId;
    }

    public void setOriReqMsgId(String oriReqMsgId) {
        this.oriReqMsgId = oriReqMsgId;
    }

    public String getOriRespType() {
        return oriRespType;
    }

    public void setOriRespType(String oriRespType) {
        this.oriRespType = oriRespType;
    }

    public String getOriRespCode() {
        return oriRespCode;
    }

    public void setOriRespCode(String oriRespCode) {
        this.oriRespCode = oriRespCode;
    }

    public String getOriRespMsg() {
        return oriRespMsg;
    }

    public void setOriRespMsg(String oriRespMsg) {
        this.oriRespMsg = oriRespMsg;
    }

    public double getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(double totalAmount) {
        this.totalAmount = totalAmount;
    }

    public double getBuyerPayAmount() {
        return buyerPayAmount;
    }

    public void setBuyerPayAmount(double buyerPayAmount) {
        this.buyerPayAmount = buyerPayAmount;
    }

    public double getPointAmount() {
        return pointAmount;
    }

    public void setPointAmount(double pointAmount) {
        this.pointAmount = pointAmount;
    }

    public String getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(String operatorId) {
        this.operatorId = operatorId;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getTerminalId() {
        return terminalId;
    }

    public void setTerminalId(String terminalId) {
        this.terminalId = terminalId;
    }

    public String getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(String buyerId) {
        this.buyerId = buyerId;
    }

    public String getBuyerAccount() {
        return buyerAccount;
    }

    public void setBuyerAccount(String buyerAccount) {
        this.buyerAccount = buyerAccount;
    }

    public Date getSettleDate() {
        return settleDate;
    }

    public void setSettleDate(Date settleDate) {
        this.settleDate = settleDate;
    }

    public String getIsClearOrCancel() {
        return isClearOrCancel;
    }

    public void setIsClearOrCancel(String isClearOrCancel) {
        this.isClearOrCancel = isClearOrCancel;
    }

    public String getChannelNo() {
        return channelNo;
    }

    public void setChannelNo(String channelNo) {
        this.channelNo = channelNo;
    }

    public String getExtend1() {
        return extend1;
    }

    public void setExtend1(String extend1) {
        this.extend1 = extend1;
    }

    public String getExtend2() {
        return extend2;
    }

    public void setExtend2(String extend2) {
        this.extend2 = extend2;
    }

    public String getExtend3() {
        return extend3;
    }

    public void setExtend3(String extend3) {
        this.extend3 = extend3;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getMerchantCode() {
        return merchantCode;
    }

    public void setMerchantCode(String merchantCode) {
        this.merchantCode = merchantCode;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getLimitPay() {
        return limitPay;
    }

    public void setLimitPay(String limitPay) {
        this.limitPay = limitPay;
    }

    public String getQrCode() {
        return qrCode;
    }

    public void setQrCode(String qrCode) {
        this.qrCode = qrCode;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public enum Status{
        PADDING("1"),SUCCESS("2"),CANCEL("3");
        private String code;

        Status(String code) {
            this.code = code;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }
    }
}

